FROM python:3.8.10
RUN mkdir /app
COPY ./requirements_docker.txt /app
# 执行之前在DOckerfile所在路径下先创建路径docker_lib ,下载allure-2.25.0.tgz并解压到docker_lib下，命名为allure-2.25.0
COPY docker_lib /app
RUN pip3 install -r /app/requirements_docker.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
WORKDIR /app/pytest-api-auto
RUN chmod 777 /app/allure-2.25.0/bin/allure
RUN ln -s /app/allure-2.25.0/bin/allure /usr/bin/allure
RUN apt update
RUN apt install -y default-jdk
# mac构建用arm Ubuntu用amd
#ENV JAVA_HOME /usr/lib/jvm/java-1.11.0-openjdk-arm64
ENV JAVA_HOME /usr/lib/jvm/java-1.11.0-openjdk-amd64
ENV JRE_HOME ${JAVA_HOME}/jre
ENV CLASSPATH .:${JAVA_HOME}/lib:${JRE_HOME}/lib
ENV PATH $PATH:${JAVA_HOME}/bin
ENV ALLURE_HOME /app/allure-2.25.0/bin/allure
ENV PATH $PATH:${ALLURE_HOME}
CMD ["python3", "run.py"]